<template>
  <div class="div-section product">
    <h2>{{pre}}</h2>
    <ul class="flower-list">
      <li v-for="(item,index) in a">
        <router-link to=""
                     :class="'flower-content'">
          <div class="flower-img">
            <img :src="item.pic">
          </div>
          <div class="flower-text">
            <p class="flower-tag"
               v-show="item.tag">{{item.tag}}</p>
            <p :class="item.tag? 'flower-name text-overflow':'flower-name'"  >{{item.name}}</p>
            <div class="product-bottom flower-bottom">
              <p class="price">{{item.price}}
                <s class="originPrice">{{item.originPrice}}</s>
              </p>
              <p class="sales">{{item.sales}}</p>
              <div class="iconfont icon-shop-cart"></div>
            </div>
          </div>
        </router-link>
      </li>
    </ul>
    <div class="product-more">
      <router-link to="">查看更多</router-link>
    </div>
  </div>

</template>
<script>
export default {
  props: ['a','pre'],
  data () {
    return {
      flower: this.a
    }
  },
  mounted(){
    console.log(this.a)
  }

}
</script>
<style  scoped>
.text-overflow {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.div-section {
  padding: 0px 10px 0px 10px;
  padding-bottom: 1.14rem;
  background: white;
}
.product {
  margin-top: 0.57rem;
}
.product h2 {
  text-align: center;
  padding: 20px 0px 20px 0px;
}
.flower-list {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  align-items: flex-start;
}
.flower-list li {
  width: 47.3%;
  margin-bottom: 0.5rem!important;
  margin: 0rem 0.25rem 0rem 0.25rem;
  box-shadow: 0 0.28571429rem 0.85714286rem 0 #e9ecf0;
  border-radius: 0.28571429rem;
}
.flower-content {
  color: inherit;
  display: block;
  text-decoration: none;
}

.flower-img img {
  width: 100%;
  display: block;
}
.flower-text {
  padding: 0rem 0.57em 1.14rem;
}
.flower-tag {
  display: inline-block;
  border-radius: 10rem;
  border: 1px solid #ff734c;
  color: #ff734c;
  font-size: 0.71428571rem;
  padding: 0 0.28571429rem;
}
.flower-name {
  color: #71797f;
  font-size: 15px;
}
.flower-bottom {
  margin-top: 0rem;
}
.product-bottom {
  margin-top: 0.5rem;
  position: relative;
}
.price {
  font-size: 1.2rem;
  color: #ff734c;
  font-weight: 500;
}
.originPrice {
  font-size: 0.7rem;
  color: #71797f;
  font-weight: 500;
}
.icon-shop-cart {
  position: absolute;
  color: #232628;
  top: 13px;
  right: 0px;
  font-size: 1rem;
}
.sales {
  font-size: 0.7rem;
}
.product-more {
  text-align: center;
  margin-top: 20px;
}
.product-more .router-link-active {
  display: inline-block;
  text-decoration: none;
  font-size: 0.7rem;
  border: 1px solid black;
  width: 5.6rem;
  height: 1.4rem;
  color: black;
  line-height: 1.3rem;
}
</style>